import React from 'react'
import { createBrowserRouter, RouterProvider } from "react-router-dom";
import Home from "@pages/home";
import Login from "@pages/login";
import Personal from "@pages/personal";
import Layout from "@shared/layout";
import Notice from "@pages/notice";
import Article from "@pages/article";
import AuthRoute from "@router/authRoute";
// import Patient from "@pages/patient";
export const router = createBrowserRouter([
  { path: "", element: <Home /> },
  { path: "/login", element: <Login /> },
  { path: "personal", element: <Personal /> },
  {
    path: "",
    element: <Layout />,
    children: [
      { path: "", element: <Home /> },
      { path: "/personal", element: <Personal /> },
    ],
  },
  { path: "/login", element: <Login /> },
  {
    path: "",
    element: <Layout />,
    children: [
      { path: "notify", element: <Notice /> },
      { path: "article", element: <Article /> },
    ],
  },
  {
    path: "",
    element: <AuthRoute children={<Layout />} />,
  },
  // {
  //   path: "",
  //   element: <AuthRoute />,
  //   children: [
  //     {
  //       path: "patient",
  //       element: <Patient />,
  //     },
  //   ],
  // },
]);

export default function AppRouter() {
  return <RouterProvider router={router} />;
}